﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using nERP.Model.Fin;
using nERP.Model;
using nERP.Model.Bas;
using nERP.Model._Admin;

namespace nERP.ViewModel.Fin.PaymentVMs
{
    public partial class PaymentTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._Payment._PayCode")]
        public ExcelPropety PayCode_Excel = ExcelPropety.CreateProperty<Payment>(x => x.PayCode);
        [Display(Name = "_Model._Payment._Supplier")]
        public ExcelPropety Supplier_Excel = ExcelPropety.CreateProperty<Payment>(x => x.SupplierId);
        [Display(Name = "_Model._Payment._MakeUser")]
        public ExcelPropety MakeUser_Excel = ExcelPropety.CreateProperty<Payment>(x => x.MakeUserId);
        [Display(Name = "_Model._Payment._SettlementType")]
        public ExcelPropety SettlementType_Excel = ExcelPropety.CreateProperty<Payment>(x => x.SettlementTypeId);
        [Display(Name = "_Model._Payment._SettlementAccount")]
        public ExcelPropety SettlementAccount_Excel = ExcelPropety.CreateProperty<Payment>(x => x.SettlementAccountId);
        [Display(Name = "_Model._Payment._TotalPrice")]
        public ExcelPropety TotalPrice_Excel = ExcelPropety.CreateProperty<Payment>(x => x.TotalPrice);
        [Display(Name = "_Model._Payment._Remark")]
        public ExcelPropety Remark_Excel = ExcelPropety.CreateProperty<Payment>(x => x.Remark);
        [Display(Name = "_Model._Payment._PayDate")]
        public ExcelPropety PayDate_Excel = ExcelPropety.CreateProperty<Payment>(x => x.PayDate, true);
        [Display(Name = "_Model._Payment._Status")]
        public ExcelPropety Status_Excel = ExcelPropety.CreateProperty<Payment>(x => x.Status);
        //[Display(Name = "_Model._Payment._CreateTime")]
        //public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<Payment>(x => x.CreateTime, true);
        //[Display(Name = "_Model._Payment._UpdateTime")]
        //public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<Payment>(x => x.UpdateTime, true);
        //[Display(Name = "_Model._Payment._CreateBy")]
        //public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<Payment>(x => x.CreateBy);
        //[Display(Name = "_Model._Payment._UpdateBy")]
        //public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<Payment>(x => x.UpdateBy);
        //[Display(Name = "_Model._Payment._IsValid")]
        //public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<Payment>(x => x.IsValid);
        //[Display(Name = "_Model._Payment._TenantCode")]
        //public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<Payment>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            SettlementType_Excel.DataType = ColumnDataType.ComboBox;
            SettlementType_Excel.ListItems = DC.Set<DicField>().Where(x => x.DicDef.DicName == "结算方式").OrderBy(x => x.Order).GetSelectListItems(Wtm, y => y.DicFieldDes.ToString(), SortByName: false);

        }

    }

    public class PaymentImportVM : BaseImportVM<PaymentTemplateVM, Payment>
    {
            //import

    }

}